package com.baby.work.service;


import com.baby.work.domain.operator.IOperator;
import com.baby.work.domain.operator.MobileOperator;
import com.baby.work.domain.operator.TelecomOperator;
import com.baby.work.domain.operator.UnicomOperator;
import com.baby.work.dto.ChargeInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.ArrayList;

@Service
public class ChargeService {
    @Autowired
    ArrayList<IOperator> operators;

    public ArrayList<ChargeInfo> charge(int min, int flow) {
        ArrayList<ChargeInfo> response = new ArrayList<>();
        for (IOperator operator : operators) {
            response.add(operator.charge(min, flow));
        }
        return response;
    }
}
